package com.example.mybatisdemo.springbootmybatis.controller;


import com.example.mybatisdemo.springbootmybatis.domian.User;
import com.example.mybatisdemo.springbootmybatis.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("install")
    public Integer install(){
        User user = new User();
        user.setAge(12);
        user.setName("kalista");

        return userService.save(user);
    }

}
